import time
import threading

def say_hello(n):
    for x in range(n):
        print("hello!!!")
        time.sleep(1)

def say_world(n):
    for y in range(n):
        print('world...')
        time.sleep(1)

# 调用
# 在创建一个新的线程 来运行say_world() 函数
t1 = threading.Thread(target=say_hello, kwargs={'n':10})
t1.start()
t2 = threading.Thread(target=say_world, args=(20,))
t2.start()  # 让 t2 线程运行


print("程序结束！")